Skip to content

Adding thermal conductivity benchmark kSRME#692

Open
bpota wants to merge 12 commits into
ddmms:mainfrom
bpota:thermal_conductivity
Open

Adding thermal conductivity benchmark kSRME#692
bpota wants to merge 12 commits into
ddmms:mainfrom
bpota:thermal_conductivity

Conversation

@bpota

@bpota bpota commented Jul 12, 2026

Copy link
Copy Markdown

Pre-review checklist for PR author

PR author must check the checkboxes below when creating the PR.

Summary

Adding k_SRME thermal conductivity benchmark.

Adding an adapted version of the Matbench-Discovery thermal conductivity script, with a FAST option to run a lower mesh and speed up the phono3py runtime, and reference data generation script. Please let me know where I could upload/send the computed reference data. The app seems to work except the plots, but the PR can have some other bugs too.

Linked issue

Resolves #92

Progress

  • Calculations
  • Analysis
  • Application
  • Documentation

Testing

No models have been tested within ml-peg. Please let me know what is the best way to arrange this. Prediction files should be compatible with Matbench-Discovery for convenience.

New decorators/callbacks

Not yet.

@ElliottKasoar ElliottKasoar added the new benchmark Proposals and suggestions for new benchmarks label Jul 13, 2026
metrics : dict[str, dict]
Metric names and values for all models.
"""
write_struct_info(data_path=STRUCTURE_FILE, out_path=OUT_PATH)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to use this rather than get_struct_info, which also has a write info option?

This would save reading STRUCTURE_FILE an additional two times as part of get_system_names and get_system_ids.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there should be any reason against changing. Thanks for the suggestion!

@ElliottKasoar

Copy link
Copy Markdown
Collaborator

Thanks for this, @bpota! We'll try to take a detailed look as soon as we can.

Regarding the data, if you want us to upload it to the S3 bucket, you can share the data with me or @joehart2001 in whatever way is easiest (here/OneDrive/Dropbox/email/Slack) and we can upload it for you.

@joehart2001

Copy link
Copy Markdown
Collaborator

I think a good way to do the fast only and full tests would be to:

  • have general running function
  • mark the full test as very_slow like e.g. phonons
  • this means when you run the test normally, on the fast one will run, and if you use the very slow cli flag then both will run

@bpota

bpota commented Jul 14, 2026

Copy link
Copy Markdown
Author

I think a good way to do the fast only and full tests would be to:

  • have general running function
  • mark the full test as very_slow like e.g. phonons
  • this means when you run the test normally, on the fast one will run, and if you use the very slow cli flag then both will run

Thanks @joehart2001, I agree this should be easier. I will change it accordingly.

Comment thread ml_peg/calcs/bulk_crystal/thermal_conductivity/data/collect_ref_kappas.py Outdated
Comment thread ml_peg/calcs/bulk_crystal/thermal_conductivity/data/reference_generation.py Outdated
Comment thread ml_peg/calcs/bulk_crystal/thermal_conductivity/calc_thermal_conductivity.py Outdated
Comment thread ml_peg/calcs/bulk_crystal/thermal_conductivity/calc_thermal_conductivity.py Outdated
Comment thread ml_peg/calcs/bulk_crystal/thermal_conductivity/collect_kappas.py Outdated
@joehart2001

Copy link
Copy Markdown
Collaborator

The run failed at the very end (after all 103 materials had been computed and saved) when writing the combined fast_kappas.json.gz / kappas.json.gz: ValueError: cannot insert material_id, already exists

  • each per-structure result dict already contains a material_id key, so pd.DataFrame(...).T has a material_id column. The code then set the index name to material_id and called reset_index(), which tries to promote that index into a second material_id column -> pandas rejects the duplicate

added code suggestions above for this

@bpota

bpota commented Jul 21, 2026

Copy link
Copy Markdown
Author

Ideas for interactivity after discussing with @joehart2001:

  • (Fast) kSRE: Predicted thermal conductivity against reference on a log-log scale.
  • (Fast) kSRME: Same violin plot as in the case of phonons.
  • Individual datapoints for both kSRE and kSRME: Predicted mode thermal conductivity against reference on a log-log scale.

bpota and others added 12 commits July 22, 2026 19:31
- Add app_thermal_conductivity.py Dash sub-app
- Replace unicode κ with k in docstrings/labels for encoding safety
- Sort DataFrames by index before metric computation for determinism
- Fix output filename: figure_conductivity -> figure_thermal_conductivity
- Add OC157 dvc.yaml, update uv.lock, add CLAUDE.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S7VGFQPPbiFQsxbHa1yKbu
Co-authored-by: Joseph Hart <92541539+joehart2001@users.noreply.github.com>
@joehart2001
joehart2001 force-pushed the thermal_conductivity branch from 413de64 to 76d8ad3 Compare July 22, 2026 18:37
@ElliottKasoar ElliottKasoar added the external Contribution from external framework label Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external Contribution from external framework new benchmark Proposals and suggestions for new benchmarks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Thermal Conductivity

3 participants